//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#include "range.h"
//
char Range::is_before(const Range &p_other)const
{
   if(this->is_null()||p_other.is_null())
   {
      return 0;
   }
   if(this->max<p_other.min)
   {
      return -1;
   }
   if(p_other.max<this->min)
   {
      return 1;
   }
   return 0;
}
QDataStream &operator<<(QDataStream &p_stream,const Range &p_range)
{
   return p_stream<<p_range.min<<p_range.max;
}
QDataStream &operator>>(QDataStream &p_stream,Range &p_range)
{
   return p_stream>>p_range.min>>p_range.max;
}
